package demo1;

public class Student1 implements Comparable {
    private String name;
    private int age;
    private double score;
    public Student1(String name, int age, double score){
        this.name=name;
        this.age=age;
        this.score=score;
    }

    @Override
    public int compareTo(Object o) {
        Student1 s=(Student1)o;
        return this.age-s.age;
    }
}
